import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
// 引入redux
import { PersistGate } from "redux-persist/integration/react";
import { Provider } from "react-redux";
import { store, persistor } from "@renderer/redux";
// 引入样式
import "@renderer/styles/reset.less";
import "@renderer/styles/normal.less";
import "@renderer/assets/fonts/font.less";
import "tdesign-react/es/style/index.css";
import App from "./App";

// 获取根DOM元素
const container = document.getElementById("root");
if (container) {
	// 创建根
	const root = createRoot(container);
	root.render(
		// * react严格模式
		<StrictMode>
			<Provider store={store}>
				<PersistGate persistor={persistor}>
					<App />
				</PersistGate>
			</Provider>
		</StrictMode>
	);
} else {
	console.error("Failed to find the root element");
}
